#pragma once
#include "context.hh"
#include "camera.hh"
#include "scene.hh"
#include "particle_system.hh"

namespace gl
{
	struct game
	{
		game() { reset(); }

		void render(context& ctx, bool ui=false) const;
		void operator()(context& ctx, bool ui=false) const { render(ctx, ui); }

		void update(float step, gl::context& ctx, int fps);
		void reset();

	private:
		gl::camera cam;
		gl::scene scene;
		particle_system ps_drive{{ 1, 1, 1 }};
		bool pause;
		int fps;
		float hp;	// health point
		float ep;	// energy point
		float speed;
		float score;
		float score_speed;
		float score_speed_amplifier;
		int crash_time;	// will be set when crashed

		enum class mode_type { start, normal, speed, rescue, crash };
		mode_type mode;
	};
}

